package cn.xingzitech.common.exception;

import cn.xingzitech.common.model.RespCode;
import lombok.Getter;

@Getter
public class CustomException extends RuntimeException {

    /**
     * 错误码
     */
    private final int code;

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
    }

    public CustomException(RespCode respCode) {
        super(respCode.getMessage());
        this.code = respCode.getCode();
    }

    public CustomException(RespCode respCode, String message) {
        super(message);
        this.code = respCode.getCode();
    }
}
